<?php echo $this->Form->create('Aluno', array('class' => 'form-horizontal'));?>
	<div class="control-group <?php echo ($this->Form->isFieldError('matricula')) ? 'error' : ''; ?>">
		<?php echo $this->Form->Label('matricula', 'Matrícula', array('class' => 'control-label'));	?>
		<div class="controls">
			<?php echo $this->Form->input('matricula', array('type' => 'text', 'label' => false, 'div' => false, 'class' => 'span5', 'required' => false, 'error' => false));	?>
			<?php echo $this->Form->error('matricula', null, array('wrap' => 'span', 'class' => 'help-block')); ?>
		</div>
	</div>
	<div class="control-group <?php echo ($this->Form->isFieldError('nome')) ? 'error' : ''; ?>">
		<?php echo $this->Form->Label('nome', 'Nome', array('class' => 'control-label'));	?>
		<div class="controls">
			<?php echo $this->Form->input('nome', array('type' => 'text', 'label' => false, 'div' => false, 'class' => 'span11', 'required' => false, 'error' => false));	?>
			<?php echo $this->Form->error('nome', null, array('wrap' => 'span', 'class' => 'help-block')); ?>
		</div>
	</div>
	<div class="control-group <?php echo ($this->Form->isFieldError('email')) ? 'error' : ''; ?>">
		<?php echo $this->Form->Label('email', 'E-mail', array('class' => 'control-label'));	?>
		<div class="controls">
			<?php echo $this->Form->input('email', array('type' => 'text', 'label' => false, 'div' => false, 'class' => 'span11', 'required' => false, 'error' => false));	?>
			<?php echo $this->Form->error('email', null, array('wrap' => 'span', 'class' => 'help-block')); ?>
		</div>
	</div>
	<div class="control-group">
		<?php echo $this->Form->Label('telefone', 'Telefone', array('class' => 'control-label'));	?>
		<div class="controls">
			<?php echo $this->Form->input('telefone', array('type' => 'text', 'label' => false, 'div' => false, 'class' => 'span5', 'required' => false));	?>
		
		</div>
	</div>
	<div class="control-group">
		<?php echo $this->Form->Label('rg', 'Nº RG', array('class' => 'control-label'));	?>
		<div class="controls">
			<?php echo $this->Form->input('rg', array('type' => 'text', 'label' => false, 'div' => false, 'class' => 'span5', 'required' => false));	?>
		</div>
	</div>
	<div class="control-group <?php echo ($this->Form->isFieldError('curso_id')) ? 'error' : ''; ?>">
		<?php echo $this->Form->Label('curso_id', 'Curso', array('class' => 'control-label'));	?>
		<div class="controls">
			<div class="input-append">
				<?php echo $this->Form->input('curso_id', array('options' => $cursos, 'empty' => true, 'label' => false, 'div' => false, 'error' => false));	?> 
				<?php echo $this->Html->link('<i class="icon-plus icon-white"></i>', array('controller' => 'cursos', 'action' => 'add'), array('escape' => false, 'class' => 'btn btn-primary', 'id' => 'btn-add-cursos')); ?>
			</div>
			<?php echo $this->Form->error('curso_id', null, array('wrap' => 'span', 'class' => 'help-block')); ?>
		</div>
	</div>
<?php echo $this->Form->hidden('id');?>
<?php echo $this->Form->end();?>

<script type="text/javascript">
	$(document).ready(function () {
		$('#AlunoTelefone').mask('(99)9999-9999');
		$('#AlunoCursoId').select2({placeholder: 'Selecione o curso do aluno...'});
	});
</script>